package card;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        CardGame cardGame = new CardGame();
        List<Card> cardList = cardGame.buyCard();
        System.out.println(cardList);

        cardGame.shuffle(cardList);
        System.out.println("洗牌："+cardList);
        cardGame.shuffle(cardList);
        System.out.println("洗牌："+cardList);


       /* for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 5; j++) {

            }
        }*/


        List<Card> hands1 = new ArrayList<>();
        List<Card> hands2 = new ArrayList<>();
        List<Card> hands3 = new ArrayList<>();

        List<List<Card>> hands = new ArrayList<>();
        hands.add(hands1);
        hands.add(hands2);
        hands.add(hands3);


        // 三个人，每个人轮流抓 5 张牌
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 3; j++) {
                Card card = cardList.remove(0);
                hands.get(j).add(card);
            }
        }

        System.out.println("第1个人的牌："+hands.get(0));
        System.out.println("第2个人的牌："+hands.get(1));
        System.out.println("第3个人的牌："+hands.get(2));
        System.out.println("剩下的牌："+cardList);

    }
}
